﻿@model EraNet.Core.Model.Account.Member
@{
    Layout = "~/Areas/LMS/Views/Shared/_parentLayOut.cshtml";
}

<script type="text/javascript">
    //回车时，默认是登陆
    function on_return(event) {
        var e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            Register();
        }
    }
    function Register() {
        var cardNo = $.trim($("#txt_cardNo").val());
        var password = $("#txt_password").val();
        var yzm = $("#yzm").val();
        var data = "&cardNo=" + cardNo + "&password=" + password + "&yzm=" + yzm;
        $.ajax({
            async: false,
            type: "POST",
            url: "/Account/AjaxCardRegister",
            dataType: "json",
            data: data,
            success: function (data) {
                switch (data) {
                    case "1": alert("卡号不能为空"); reloadcode_stu();
                        break;
                    case "2": alert("密码不能为空！"); reloadcode_stu();
                        break;
                    case "3": alert("验证码不能为空"); reloadcode_stu();
                        break;
                    case "4": alert("验证码错误！"); reloadcode_stu();
                        break;
                    case "5": alert("卡号不存在。"); reloadcode_stu();
                        break;
                    case "6": alert("密码错误,请重新输入。"); reloadcode_stu();
                        break;
                    case "7": alert("学习卡已经被使用。"); reloadcode_stu();
                        break;
                    case "8": alert("密码错误,请重新输入。"); reloadcode_stu();
                        break;
                    case "10": alert("激活成功。"); location.href = "/Account/Infos";
                        break;
                    default: alert("登录失败!"); reloadcode_stu();
                        break;
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert('请求出现异常，请稍后再试'); reloadcode_stu();
            }

        });
    }
</script>


<body  onkeydown="on_return(event);">
<header id="top">
<div class="wrapper-login">
<div id="title"><img src="/styles/img/logo.png" alt="Administry" /></div>
<nav id="menu">
<ul class="sf-menu">
<li class="current" ><a href="###">学习卡激活</a></li>
</ul>
</nav>
<aside><a href="#">在线客服</a> &middot; <a href="#">说明</a></aside>
</div>
</header>
<div >
<div id="pagetitle">
<div class="wrapper-login"></div>
</div>

<div id="page">
<div id="mup_lg" class="wrapper-login">
<div class="full">					
<h3>学习卡激活</h3>
<div class="box box-info">输入您的学习卡账号密码进行激活。<br /><br /></div>
<div id="mlogin">
<p>
<label class="required" for="cardNo">学习卡号:</label><br/>
<input type="text" id="txt_cardNo" class="full" value="" name="cardNo"/>
</p>
<p>
<label class="required" for="password">密码:</label><br/>
<input type="password" id="txt_password" class="full" value="" name="password"/>
</p>
<p>
<label class="required" for="yam">验证码:</label><br/>
<input type="text" id="yzm" name="yzm" class="loginyzm"/>
              <img alt="验证码" id="Img1" class="yzmimg" src="@Url.Action("CreateImageCode", "SecurityCode")" onclick="reloadcode_stu()"  />
                <script type="text/javascript">
                    function reloadcode_stu() {
                        var verify = document.getElementById('Img1');
                        verify.setAttribute('src', '@Url.Content("~/SecurityCode/CreateImageCode?")' + Math.random());
                    }
                    $(function () {
                        $("#Img1").click();
                    });
                </script>
</p>

<div class="clear">&nbsp;</div>
</div>
<input type="button" class="btn btn-green big" value="激 活" onclick="Register()" />
</div> 
</div>
</div>
</div>
</body>
